home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / libs / libelf-0.5 / libelf-0 / libelf-0.5.2 / configure.in < prev    next >
Encoding:
Text File  |  1995-10-21  |  3.5 KB  |  134 lines

  1. # Configure template for libelf
  2. # Copyright (C) 1995 Michael Riepe <riepe@ifwsn4.ifw.uni-hannover.de>
  3. # Process this file with autoconf to produce a configure script.
  4.  
  5. AC_INIT(32.fsize.c)
  6. AC_CONFIG_HEADER(config.h)
  7.  
  8. AC_PREREQ(2.4)
  9.  
  10. PACKAGE=libelf
  11. VERSION=0.5.2
  12. dnl AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
  13. dnl AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
  14. AC_SUBST(PACKAGE)
  15. AC_SUBST(VERSION)
  16.  
  17. MAJOR=`echo $VERSION | sed 's/\..*//'`
  18. AC_SUBST(MAJOR)
  19.  
  20. dnl Checks for programs.
  21. AC_PROG_MAKE_SET
  22. AC_PROG_CC
  23. AC_PROG_CPP
  24. AC_PROG_INSTALL
  25. AC_PROG_RANLIB
  26. AC_PROG_LN_S
  27.  
  28. dnl Checks for libraries.
  29.  
  30. dnl Checks for header files.
  31. AC_HEADER_STDC
  32. AC_CHECK_HEADERS(unistd.h)
  33.  
  34. install_headers=''
  35. AC_SUBST(install_headers)
  36.  
  37. AC_MSG_CHECKING([for elf.h])
  38. AC_CACHE_VAL(libelf_cv_header_elf_h,
  39.   [libelf_cv_header_elf_h=''
  40.   AC_TRY_CPP([#include <elf.h>],
  41.     [libelf_cv_header_elf_h='elf.h'],
  42.     [AC_TRY_CPP([#include <sys/elf.h>],
  43.       [libelf_cv_header_elf_h='sys/elf.h'])])])
  44. if test -n "$libelf_cv_header_elf_h"; then
  45.   AC_MSG_RESULT($libelf_cv_header_elf_h)
  46.   elf_h="$libelf_cv_header_elf_h"
  47.   dnl
  48.   dnl Slowaris declares Elf32_Dyn in <link.h>
  49.   dnl
  50.   AC_MSG_CHECKING([where Elf32_Dyn is declared])
  51.   AC_CACHE_VAL(libelf_cv_struct_elf32_dyn,
  52.     [libelf_cv_struct_elf32_dyn='not found'
  53.     for file in "$elf_h" 'link.h'
  54.     do
  55.       AC_TRY_COMPILE([#include <$file>], [Elf32_Dyn x;],
  56.         [libelf_cv_struct_elf32_dyn="$file"
  57.         break])
  58.     done])
  59.   AC_MSG_RESULT([$libelf_cv_struct_elf32_dyn])
  60.   if test "$libelf_cv_struct_elf32_dyn" = 'not found'; then
  61.     AC_MSG_ERROR([no declaration for Elf32_Dyn])
  62.   else
  63.     if test "$libelf_cv_struct_elf32_dyn" = 'link.h'; then
  64.       AC_DEFINE(NEED_LINK_H)
  65.     fi
  66.   fi
  67.   dnl
  68.   dnl Linux declares struct nlist in <elf.h>
  69.   dnl
  70.   AC_MSG_CHECKING([whether $elf_h declares struct nlist])
  71.   AC_CACHE_VAL(libelf_cv_struct_nlist,
  72.     [AC_TRY_COMPILE([#include <$elf_h>], [struct nlist nl;],
  73.       libelf_cv_struct_nlist=yes, libelf_cv_struct_nlist=no)])
  74.   AC_MSG_RESULT($libelf_cv_struct_nlist)
  75.   if test "$libelf_cv_struct_nlist" = yes; then
  76.     AC_DEFINE(HAVE_STRUCT_NLIST_DECLARATION)
  77.   fi
  78. else
  79.   AC_MSG_RESULT([not found])
  80.   install_headers="$install_headers elf.h"
  81.   elf_h='elf.h'
  82. fi
  83. AC_SUBST(elf_h)
  84.  
  85. dnl Checks for typedefs, structures, and compiler characteristics.
  86. AC_C_CONST
  87. AC_TYPE_OFF_T
  88. AC_TYPE_SIZE_T
  89.  
  90. dnl Checks for library functions.
  91. AC_CHECK_FUNCS(ftruncate memcmp memcpy memmove)
  92. AC_REPLACE_FUNCS(memset)
  93. if test "$ac_cv_func_memset" = yes; then
  94.   AC_DEFINE(HAVE_MEMSET)
  95. fi
  96.  
  97. AC_MSG_CHECKING(whether overlapping arrays are copied correctly)
  98. AC_CACHE_VAL(libelf_cv_working_memmove,
  99.   [AC_TRY_RUN(changequote(<<, >>)dnl
  100.     <<#include "confdefs.h"
  101.     #if HAVE_MEMMOVE
  102.     extern void *memmove();
  103.     #else
  104.     extern void bcopy();
  105.     #define memmove(d,s,n) bcopy((s),(d),(n))
  106.     #endif
  107.     extern int strcmp();
  108.     main() {
  109.       char buf[] = "0123456789";
  110.       memmove(buf + 1, buf, 9);
  111.       if (strcmp(buf, "0012345678")) exit(1);
  112.       exit(0);
  113.     }>>, changequote([, ])dnl
  114.     libelf_cv_working_memmove=yes,
  115.     libelf_cv_working_memmove=no,
  116.     libelf_cv_working_memmove=no)])
  117. AC_MSG_RESULT($libelf_cv_working_memmove)
  118. if test "$libelf_cv_working_memmove" != yes; then
  119.   AC_DEFINE(HAVE_BROKEN_MEMMOVE)
  120. fi
  121.  
  122. dnl Checks for NLS feature support
  123. mr_ENABLE_NLS([
  124.   ac_save_path="$PATH"
  125.   PATH=/usr/local/bin:/usr/bin:/bin
  126.   AC_PATH_PROG(GENCAT, gencat, :)
  127.   PATH="$ac_save_path"
  128.   mr_SYS_NLS_CATGETS([AC_DEFINE(HAVE_NLS)],
  129.     [AC_MSG_WARN([no NLS support, feature disabled])])
  130. ])
  131.  
  132. AC_OUTPUT(Makefile shared/Makefile support/Makefile libelf.h,
  133.     echo timestamp > stamp-h)
  134.